import { defHttp } from '/@/utils/http/axios';
import { RoleInfo } from './model/roleModel';

enum Api {
  FindRoleList = '/inyaa-admin/role/list',
  SaveRole = '/inyaa-admin/role/save',
  DeleteRole = '/inyaa-admin/role/delete',
}

export function findRoleList() {
  return defHttp.get<RoleInfo>({ url: Api.FindRoleList });
}

export function saveRole(role: RoleInfo) {
  return defHttp.post<RoleInfo>({ url: Api.SaveRole, params: role });
}

export function deleteRole(role: RoleInfo) {
  return defHttp.post<RoleInfo>({ url: Api.DeleteRole, params: role });
}
